import socketserver
import queue

ip_port = ("127.0.0.1", 8000)


class Client():
    def __init__(self,name,):

    pass


class Client_list():
    pass


class Game_room():
    room_list=[]
    def add_room(self):
        self.room_list.append()
    pass


class MyServer(socketserver.BaseRequestHandler):
    def handle(self):
        while True:
            try:
                # 收消息
                data = self.request.recv(1024)
                if not data: break

                self.request.sendall(data.upper())
            except Exception as e:
                print(e)
                break


if __name__ == "__main__":
    s = socketserver.ThreadingTCPServer(ip_port, MyServer)
    s.serve_forever()
